import axios from "axios"

const service = axios.create({
    // baseURL: "http://192.168.1.28:9528",
    timeout: 3000
})
// 请求拦截
service.interceptors.request.use(config => {
    // if(config.headers["content-type"] != "multipart/form-data")
    // config.headers["content-type"] = "application/x-www-form-urlencoded"
    console.log(123);
    // 带入登录标识
    let token = localStorage.getItem("token")
    if(token){
        config.headers["X-Token"] = token
    }
    return config
})

// 响应拦截
service.interceptors.response.use(config => {
    return config.data
})

export default service